<template>
	<div class="read">
		<h3 class="title">政策解读</h3>
		<div class="banxin read-box clearfix">
			<div class="l-one fll">
				<img src="./src/style/img/books.png" alt="">
				<h3>什么是平行志愿？</h3>
				<div class="min-height">平行志愿是什么意思？易高考网站为您解答：“所谓平行志愿，主要指采用平行志愿院校录取时，考生所选A、B、C、D等志愿，他们
				</div>
				<span class="flr all-content" @click=policy>[<i>查看全文</i>]</span>
			</div>
			<div class="rone fll">
				<ul class="clearfix" v-cloak>
					<li v-for='(list, index) of lists' :key=index>
					  <a :href='"view/policy.html?index="+index'>
						  <div class="fll r-left">
						 	  <img :src='"./src/style/img/z"+(index%6+1)+".png"' alt="">
						  </div>
						  <div class="flr rright">
						 	<h5>{{list.title}}？</h5>
						 	<p>{{list.content}}</p>
						  </div>
					  </a>
					</li>
				</ul>
			</div>
		</div>
	</div>
</template>
<script>
	module['index-read'] = {
	data: function data() {
		return {
			lists: []
		};
	},
	template: template,
	created: function created() {
		var that = this;
		base.request(base.api(57), { city: that.city }, function (data) {
			if (data.data.length > 0) {
				var _iteratorNormalCompletion = true;
				var _didIteratorError = false;
				var _iteratorError = undefined;

				try {
					for (var _iterator = data.data[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
						var value = _step.value;
						console.log(value.id)
						base.request(base.api(58), { id: value.id }, function (d) {
							if (d.data) {
								value.content = d.data.content;
								that.lists.push(value);
								sessionStorage.gk = JSON.stringify(that.lists);
							}
						});
					}
				} catch (err) {
					_didIteratorError = true;
					_iteratorError = err;
				} finally {
					try {
						if (!_iteratorNormalCompletion && _iterator.return) {
							_iterator.return();
						}
					} finally {
						if (_didIteratorError) {
							throw _iteratorError;
						}
					}
				}
			}
		});
	},
	methods: {
		policy: function policy() {
			this.$router.push({ name:'policy',path: '/policy' ,params:{lists:this.lists}});
		}
	}
};
</script>
